﻿<Window x:Class="RL.wRouteType"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Тип маршрута" Height="300" Width="300" Loaded="Window_Loaded">
    <Window.Resources>
        <CollectionViewSource x:Key="sourceRouteType"/>
        <DataTemplate x:Key="cellDel">
            <CheckBox IsChecked="{Binding Path=del}" IsEnabled="False"/>
        </DataTemplate>
        <DataTemplate x:Key="cellName">
            <TextBlock Text="{Binding Path=name}" />
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="175*" />
        </Grid.RowDefinitions>
        <StackPanel Name="stackPanel1" Orientation="Horizontal" >
            <Button Content="Добавить" Height="23" Name="buttonAdd" Width="75" Click="buttonAdd_Click" />
            <Button Content="Удалить" Height="23" Name="buttonDelete" Width="75" Click="buttonDelete_Click" />
            <Button Content="Редактировать" Height="23" Name="buttonEdit" Width="92" Click="buttonEdit_Click" />
        </StackPanel>
        <ListView Grid.Row="1" Name="listView1" ItemsSource="{Binding Source={StaticResource sourceRouteType}}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Выкл." Width="35" CellTemplate="{StaticResource cellDel}" />
                    <GridViewColumn Header="Тип маршрута" CellTemplate="{StaticResource cellName}"/>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</Window>
